using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SelectableButton : MonoBehaviour
{
    [SerializeField] 
    public Sprite selectedSprite;
    [SerializeField] 
    public Sprite normalSprite;

    public Image buttonImage;
    private bool isSelected;

    void Start()
    {
        UpdateColor();
    }

    public void ToggleSelection(bool s)
    {
        isSelected = s;
        UpdateColor();
    }

    private void UpdateColor()
    {
        buttonImage.sprite = isSelected ? selectedSprite : normalSprite;
    }
}
